package com.accenture.portal.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import net.sf.json.JSONArray;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.accenture.portal.dao.impl.LinkMapperImpl;
import com.accenture.portal.model.Link;
import com.accenture.portal.service.LinkService;

@Service
public class LinkServiceImpl implements LinkService {

	@Autowired
	private LinkMapperImpl link;

	public LinkMapperImpl getLink() {
		return link;
	}

	@Resource
	public void setLink(LinkMapperImpl link) {
		this.link = link;
	}

	@Override
	public List<Link> SearchAllLink() {
		List<Link> searchLink = link.searchAllLink();
		// new JSONArray();
		// return JSONArray.fromObject(searchLink).toString();
		return searchLink;
	}

	@Override
	public void AddLink(Link addLink) {
		link.addLink(addLink);

	}

	@Override
	public void DeleteLink(Integer linkID) {
		link.deleteLink(linkID);
	}

	@Override
	public void DeleteLinkLink(Integer linkID) {
		link.deleteLinkLink(linkID);
	}

	@Override
	public void updateLink(Link editLink) {
		 link.updateLink(editLink);
	}

	@Override
	public Link SearchLinkByLinkId(int linkID) {
		return link.searchLinkByLinkId(linkID);
	}
	
	@Override
	public List<Link> searchLinkByName(String linkname)
	{
		// TODO Auto-generated method stub
		return link.searchLinkByName(linkname);
	}
	
	@Override
	public List<Link> SearchQuickLink() {
		
		return link.searchQuickLink();
	} 
	
}
